package com.account.dao;

import java.util.Date;

import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;


import com.account.basedao.BaseDAO;
import com.account.entity.Registration;
import com.account.interfaces.IRegistrationdao;

public class RegistrationDAO extends BaseDAO implements IRegistrationdao {

	@Override
	public boolean setRegistration(String firstname, String lastname,
			java.util.Date dob, String fathername, String thikana,
			String qualification, String status, Long contactNo,
			String emailid, java.util.Date joindate) {
		
		AnnotationConfiguration annotationConfigration=getConfiguration();
		SessionFactory sessionfactory=annotationConfigration.buildSessionFactory();
		Session session=getSession(sessionfactory);
		Transaction transaction=getTransaction(session);
		
		Registration registration=new Registration();
		registration.setContactNo(contactNo);
		registration.setFirstName(firstname);
		registration.setLastName(lastname);
		registration.setThikana(thikana);
		registration.setDob(dob);
		registration.setFatherName(fathername);
		registration.setQualification(qualification);
		registration.setStatus(status);
		registration.setJoinDate(joindate);
		registration.setEmailId(emailid);
		
		//session.saveOrUpdate(registration);
		session.save(registration);
		close(sessionfactory, session, transaction);
	
		
	
	return false;
		
		
	}


	

	
}
